<?php

namespace Part15_AbstractFactoryPattern\Code4;

require_once '../../autoload.php';

$user = new User();
$department = new Department();

// 修改数据源，去到里面修改配置即可
$factory = new DataAccess();

$iUser = $factory->createUser();

// 模拟插入用户
$iUser->insert($user);
// 模拟获取用户
$iUser->getUser(1);

// 新增department的操作
$iDepartment = $factory->createDepartment();
$iDepartment->insert($user);
$iDepartment->getDepartment(1);